<?php
/**
 * @ClassName: Theme
 * @Description: APP主题
 * @author: wyaohu
 * @Date: 2024-09-08 23:03
 * @Version: V1.0.0
 */

namespace app\common\model;

use think\Model;
use think\model\concern\SoftDelete;

class Theme extends Model
{
    use SoftDelete;

    protected $name = 'theme';

    protected $autoWriteTimestamp = 'dateTime';

    public function getColorPickerHtmlAttr($value, $data)
    {
        return "<div style='width: auto;height: 40px;margin: 0 auto;background: " . $data['color_picker'] . ";'></div>";
    }

    public function getGradientColorHtmlAttr($value, $data)
    {
        return "<div style='width: 50%;height: 40px;margin: 0 auto;background: " . $data['gradient_color'] . ";'></div>";
    }

}